/*
 * Message.cpp
 *
 *  Created on: 2012-12-18
 *      Author: yangentao@gmail.com
 */

#include "Message.h"

namespace yet {

Message::Message() {
	this->msg = 0;
	this->argN = 0;
	this->argP = 0;
	quit = false;
}

Message::Message(int msg) {
	init(msg, 0, "", 0);
}
Message::Message(int msg, int argN) {
	init(msg, argN, "", 0);
}
Message::Message(int msg, String argS) {
	init(msg, 0, argS, 0);
}
Message::Message(int msg, int argN, String argS) {
	init(msg, argN, argS, 0);
}
Message::Message(const Message& other) {
	msg = other.msg;
	argN = other.argN;
	argS = other.argS;
	argP = other.argP;
	quit = other.quit;
}
void Message::init(int msg, int argN, String argS, void* argP, bool quit) {
	this->msg = msg;
	this->argN = argN;
	this->argS = argS;
	this->argP = argP;
	this->quit = quit;
}

bool Message::isQuit() {
	return quit;
}

bool Message::equals(const Message& other) const {
	return argS.equals(other.argS) && msg == other.msg && argN == other.argN && argP == other.argP && quit == other.quit;
}
}

